home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / X11 / extensions / multibufst.h < prev    next >
C/C++ Source or Header  |  2006-04-12  |  19KB  |  610 lines

  1. /*
  2.  * $Xorg: multibufst.h,v 1.4 2001/02/09 02:03:24 xorgcvs Exp $
  3.  *
  4. Copyright 1989, 1998  The Open Group
  5.  
  6. Permission to use, copy, modify, distribute, and sell this software and its
  7. documentation for any purpose is hereby granted without fee, provided that
  8. the above copyright notice appear in all copies and that both that
  9. copyright notice and this permission notice appear in supporting
  10. documentation.
  11.  
  12. The above copyright notice and this permission notice shall be included in
  13. all copies or substantial portions of the Software.
  14.  
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  18. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  19. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  20. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21.  
  22. Except as contained in this notice, the name of The Open Group shall not be
  23. used in advertising or otherwise to promote the sale, use or other dealings
  24. in this Software without prior written authorization from The Open Group.
  25.  */
  26.  
  27. /* $XFree86: xc/include/extensions/multibufst.h,v 3.8 2001/12/19 21:37:29 dawes Exp $ */
  28.  
  29. #ifndef _MULTIBUFST_H_
  30. #define _MULTIBUFST_H_
  31.  
  32. /*
  33.  * Protocol requests constants and alignment values
  34.  */
  35.  
  36. #include "multibuf.h"
  37. #ifdef _MULTIBUF_SERVER_
  38. #include "inputstr.h"
  39. #endif
  40.  
  41. #if !defined(UNIXCPP) || defined(ANSICPP)
  42. #define MbufGetReq(name,req,info) GetReq (name, req); \
  43.     req->reqType = info->codes->major_opcode; \
  44.     req->mbufReqType = X_##name;
  45. #else
  46. #define MbufGetReq(name,req,info) GetReq (name, req); \
  47.     req->reqType = info->codes->major_opcode; \
  48.     req->mbufReqType = X_/**/name;
  49. #endif
  50.  
  51. #define Window CARD32
  52. #define Drawable CARD32
  53. #define VisualID CARD32
  54. #define Multibuffer CARD32
  55.  
  56. typedef struct xMbufBufferInfo {
  57.     CARD32    visualID B32;        /* associated visual */
  58.     CARD16    maxBuffers B16;        /* maximum supported buffers */
  59.     CARD8    depth;            /* depth of visual (redundant) */
  60.     CARD8    unused;
  61. } xMbufBufferInfo;
  62. #define sz_xMbufBufferInfo 8
  63.  
  64. typedef struct {
  65.     BYTE    type;
  66.     BYTE    unused;
  67.     CARD16  sequenceNumber B16;
  68.     CARD32  buffer B32;            /* affected buffer */
  69.     BYTE    state;            /* current status */
  70.     CARD8   unused1;
  71.     CARD16  unused2 B16;
  72.     CARD32  unused3 B32;
  73.     CARD32  unused4 B32;
  74.     CARD32  unused5 B32;
  75.     CARD32  unused6 B32;
  76.     CARD32  unused7 B32;
  77. } xMbufClobberNotifyEvent;
  78.  
  79. typedef struct {
  80.     BYTE    type;
  81.     BYTE    unused;
  82.     CARD16  sequenceNumber B16;
  83.     CARD32  buffer B32;            /* affected buffer */
  84.     CARD32  timeStamp B32;        /* update time */
  85.     CARD32  unused1 B32;
  86.     CARD32  unused2 B32;
  87.     CARD32  unused3 B32;
  88.     CARD32  unused4 B32;
  89.     CARD32  unused5 B32;
  90.     CARD32  unused6 B32;
  91. } xMbufUpdateNotifyEvent;
  92.  
  93. typedef struct {
  94.     CARD8    reqType;        /* always codes->major_opcode */
  95.     CARD8    mbufReqType;        /* always X_MbufGetBufferVersion */
  96.     CARD16    length B16;
  97. } xMbufGetBufferVersionReq;
  98. #define sz_xMbufGetBufferVersionReq    4
  99.  
  100. typedef struct {
  101.     BYTE    type;            /* X_Reply */
  102.     CARD8    unused;            /* not used */
  103.     CARD16    sequenceNumber B16;
  104.     CARD32    length B32;
  105.     CARD8    majorVersion;    /* major version of Multi-Buffering protocol */
  106.     CARD8    minorVersion;    /* minor version of Multi-Buffering protocol */
  107.     CARD16    pad1 B16;
  108.     CARD32    pad2 B32;
  109.     CARD32    pad3 B32;
  110.     CARD32    pad4 B32;
  111.     CARD32    pad5 B32;
  112.     CARD32    pad6 B32;
  113. } xMbufGetBufferVersionReply;
  114. #define sz_xMbufGetBufferVersionReply    32
  115.  
  116. typedef struct {
  117.     CARD8    reqType;    /* always codes->major_opcode */
  118.     CARD8    mbufReqType;    /* always X_MbufCreateImageBuffers */
  119.     CARD16    length B16;
  120.     CARD32    window B32;    /* associated window */
  121.     CARD8    updateAction;    /* action at update */
  122.     CARD8    updateHint;    /* hint as to frequency of updates */
  123.     CARD16    unused;
  124. } xMbufCreateImageBuffersReq;    /* followed by buffer ids */
  125. #define sz_xMbufCreateImageBuffersReq    12
  126.  
  127. typedef struct {
  128.     BYTE    type;            /* X_Reply */
  129.     CARD8    unused;            /* not used */
  130.     CARD16    sequenceNumber B16;
  131.     CARD32    length B32;
  132.     CARD16    numberBuffer B16;    /* number successfully allocated */
  133.     CARD16    unused1 B16;
  134.     CARD32    unused2 B32;
  135.     CARD32    unused3 B32;
  136.     CARD32    unused4 B32;
  137.     CARD32    unused5 B32;
  138.     CARD32    unused6 B32;
  139. } xMbufCreateImageBuffersReply;
  140. #define sz_xMbufCreateImageBuffersReply 32
  141.  
  142. typedef struct {
  143.     CARD8    reqType;    /* always codes->major_opcode */
  144.     CARD8    mbufReqType;    /* always X_MbufDestroyImageBuffers */
  145.     CARD16    length B16;
  146.     CARD32    window B32;    /* associated window */
  147. } xMbufDestroyImageBuffersReq;
  148. #define sz_xMbufDestroyImageBuffersReq    8
  149.  
  150. typedef struct {
  151.     CARD8    reqType;    /* always codes->major_opcode */
  152.     CARD8    mbufReqType;    /* always X_MbufDisplayImageBuffers */
  153.     CARD16    length B16;
  154.     CARD16    minDelay B16;    /* minimum time between last update and now */
  155.     CARD16    maxDelay B16;    /* maximum time between last update and now */
  156. } xMbufDisplayImageBuffersReq;    /* followed by list of buffers */
  157. #define sz_xMbufDisplayImageBuffersReq    8
  158.  
  159. typedef struct {
  160.     CARD8    reqType;    /* always codes->major_opcode */
  161.     CARD8    mbufReqType;    /* always X_MbufSetMBufferAttributes */
  162.     CARD16    length B16;
  163.     CARD32    window B32;    /* associated window */
  164.     CARD32    valueMask B32;    /* modified entries */
  165. } xMbufSetMBufferAttributesReq;    /* followed by values */
  166. #define sz_xMbufSetMBufferAttributesReq 12
  167.  
  168. typedef struct {
  169.     CARD8    reqType;    /* always codes->major_opcode */
  170.     CARD8    mbufReqType;    /* always X_MbufGetMBufferAttributes */
  171.     CARD16    length B16;
  172.     CARD32    window B32;    /* associated window */
  173. } xMbufGetMBufferAttributesReq;
  174. #define sz_xMbufGetMBufferAttributesReq 8
  175.  
  176. typedef struct {
  177.     BYTE    type;            /* X_Reply */
  178.     CARD8    unused;            /* not used */
  179.     CARD16    sequenceNumber B16;
  180.     CARD32    length B32;
  181.     CARD16    displayedBuffer B16;    /* currently visible buffer */
  182.     CARD8    updateAction;
  183.     CARD8    updateHint;
  184.     CARD8    windowMode;
  185.     CARD8    unused0;
  186.     CARD16    unused1 B16;
  187.     CARD32    unused2 B32;
  188.     CARD32    unused3 B32;
  189.     CARD32    unused4 B32;
  190.     CARD32    unused5 B32;
  191. } xMbufGetMBufferAttributesReply;
  192. #define sz_xMbufGetMBufferAttributesReply 32
  193.  
  194. typedef struct {
  195.     CARD8    reqType;    /* always codes->major_opcode */
  196.     CARD8    mbufReqType;    /* always X_MbufSetBufferAttributes */
  197.     CARD16    length B16;
  198.     CARD32    buffer B32;
  199.     CARD32    valueMask B32;
  200. } xMbufSetBufferAttributesReq;    /* followed by values */
  201. #define sz_xMbufSetBufferAttributesReq 12
  202.  
  203. typedef struct {
  204.     CARD8    reqType;    /* always codes->major_opcode */
  205.     CARD8    mbufReqType;    /* always X_MbufGetBufferAttributes */
  206.     CARD16    length B16;
  207.     CARD32    buffer B32;
  208. } xMbufGetBufferAttributesReq;
  209. #define sz_xMbufGetBufferAttributesReq 8
  210.  
  211. typedef struct {
  212.     BYTE    type;            /* X_Reply */
  213.     CARD8    unused;            /* not used */
  214.     CARD16    sequenceNumber B16;
  215.     CARD32    length B32;
  216.     CARD32    window B32;
  217.     CARD32    eventMask B32;
  218.     CARD16    bufferIndex B16;
  219.     CARD8    side;
  220.     CARD8    unused0;
  221.     CARD32    unused1 B32;
  222.     CARD32    unused2 B32;
  223.     CARD32    unused3 B32;
  224. } xMbufGetBufferAttributesReply;
  225. #define sz_xMbufGetBufferAttributesReply 32
  226.  
  227. typedef struct {
  228.     CARD8    reqType;    /* always codes->major_opcode */
  229.     CARD8    mbufReqType;    /* always X_MbufGetBufferInfo */
  230.     CARD16    length B16;
  231.     Drawable    drawable B32;
  232. } xMbufGetBufferInfoReq;
  233. #define sz_xMbufGetBufferInfoReq 8
  234.  
  235. typedef struct {
  236.     BYTE    type;            /* X_Reply */
  237.     CARD8    unused;            /* not used */
  238.     CARD16    sequenceNumber B16;
  239.     CARD32    length B32;
  240.     CARD16    normalInfo B16;
  241.     CARD16    stereoInfo B16;
  242.     CARD32    unused1 B32;
  243.     CARD32    unused2 B32;
  244.     CARD32    unused3 B32;
  245.     CARD32    unused4 B32;
  246.     CARD32    unused5 B32;
  247. } xMbufGetBufferInfoReply;            /* followed by buffer infos */
  248. #define sz_xMbufGetBufferInfoReply 32
  249.  
  250.  
  251. typedef struct {
  252.     CARD8    reqType;    /* always codes->major_opcode */
  253.     CARD8    mbufReqType;    /* always X_MbufCreateStereoWindow */
  254.     CARD16    length B16;
  255.     CARD8    unused0;
  256.     CARD8    unused1;
  257.     CARD8    unused2;
  258.     CARD8    depth;
  259.     Window    wid B32;
  260.     Window    parent B32;
  261.     Multibuffer    left B32;    /* associated buffers */
  262.     Multibuffer    right B32;
  263.     INT16    x B16;
  264.     INT16    y B16;
  265.     CARD16    width B16;
  266.     CARD16    height B16;
  267.     CARD16    borderWidth B16;  
  268. #if defined(__cplusplus) || defined(c_plusplus)
  269.     CARD16    c_class B16;
  270. #else
  271.     CARD16    class B16;
  272. #endif
  273.     VisualID    visual B32;
  274.     CARD32    mask B32;
  275. } xMbufCreateStereoWindowReq;        /* followed by value list */
  276. #define sz_xMbufCreateStereoWindowReq 44
  277.  
  278. typedef struct {
  279.     CARD8     reqType;        /* always codes->major_opcode */
  280.     CARD8     mbufReqType;    /* always X_MbufClearImageBufferArea */
  281.     CARD16    length B16;
  282.     Multibuffer       buffer B32;
  283.     INT16     x B16;
  284.     INT16     y B16;
  285.     CARD16    width B16;
  286.     CARD16    height B16;
  287.     CARD8     unused0;
  288.     CARD8     unused1;
  289.     CARD8     unused2;
  290.     BOOL      exposures;
  291. } xMbufClearImageBufferAreaReq;
  292. #define sz_xMbufClearImageBufferAreaReq 20
  293.  
  294. #undef Window
  295. #undef Drawable
  296. #undef VisualID
  297. #undef Multibuffer
  298.  
  299.  
  300. #ifdef _MULTIBUF_SERVER_
  301. /* Macros for wrapping and unwrapping functions */
  302.  
  303. #define SWAP_FUNC_VECTOR(pSTRUCT1,pSTRUCT2,DATA_TYPE,FUNC_NAME)        \
  304. {                                    \
  305.     DATA_TYPE (* tmpFn)();                        \
  306.                                         \
  307.     tmpFn = pSTRUCT1->FUNC_NAME;                    \
  308.     pSTRUCT1->FUNC_NAME = pSTRUCT2->FUNC_NAME;                \
  309.     pSTRUCT2->FUNC_NAME = tmpFn;                    \
  310. }
  311.  
  312. #if !defined(UNIXCPP) || defined(ANSICPP)
  313. #define WRAP_SCREEN_FUNC(pSCREEN,pPRIV,FUNC_NAME, PRIV_FUNC_NAME)    \
  314. {                                    \
  315.     if ((pPRIV->funcsWrapped & FUNC_NAME##Mask) == 0)            \
  316.     {                                    \
  317.     pPRIV->FUNC_NAME   = pSCREEN->FUNC_NAME;            \
  318.     pSCREEN->FUNC_NAME = PRIV_FUNC_NAME;                \
  319.     pPRIV->funcsWrapped |= FUNC_NAME##Mask;                \
  320.     }                                    \
  321. }
  322.  
  323. #define UNWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME)        \
  324. {                                    \
  325.     SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME);        \
  326.     pPRIV->funcsWrapped &= ~(FUNC_NAME##Mask);                \
  327. }
  328.  
  329. #define REWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME)        \
  330. {                                    \
  331.     if (MB_SCREEN_PRIV(pSCREEN)->mbufWindowCount)            \
  332.     {                                    \
  333.     SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME);        \
  334.     pPRIV->funcsWrapped |= FUNC_NAME##Mask;                \
  335.     }                                    \
  336. }
  337. #else
  338. #define WRAP_SCREEN_FUNC(pSCREEN,pPRIV,FUNC_NAME, PRIV_FUNC_NAME)    \
  339. {                                    \
  340.     if ((pPRIV->funcsWrapped & FUNC_NAME/**/Mask) == 0)            \
  341.     {                                    \
  342.     pPRIV->FUNC_NAME   = pSCREEN->FUNC_NAME;            \
  343.     pSCREEN->FUNC_NAME = PRIV_FUNC_NAME;                \
  344.     pPRIV->funcsWrapped |= FUNC_NAME/**/Mask;            \
  345.     }                                    \
  346. }
  347.  
  348. #define UNWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME)        \
  349. {                                    \
  350.     SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME);        \
  351.     pPRIV->funcsWrapped &= ~(FUNC_NAME/**/Mask);            \
  352. }
  353.  
  354. #define REWRAP_SCREEN_FUNC(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME)        \
  355. {                                    \
  356.     if (MB_SCREEN_PRIV(pSCREEN)->mbufWindowCount)            \
  357.     {                                    \
  358.     SWAP_FUNC_VECTOR(pSCREEN,pPRIV,DATA_TYPE,FUNC_NAME);        \
  359.     pPRIV->funcsWrapped |= FUNC_NAME/**/Mask;            \
  360.     }                                    \
  361. }
  362. #endif
  363.  
  364. /* The _Multibuffer and _Multibuffers structures below refer to each other,
  365.  * so we need this forward declaration
  366.  */
  367. typedef struct _Multibuffers    *MultibuffersPtr;
  368.  
  369. /*
  370.  * per-Multibuffer data
  371.  */
  372.  
  373. typedef struct _Multibuffer {
  374.     MultibuffersPtr pMultibuffers;  /* associated window data */
  375.     Mask        eventMask;        /* MultibufferClobberNotifyMask|ExposureMask|MultibufferUpdateNotifyMask */
  376.     Mask        otherEventMask; /* mask of all other clients event masks */
  377.     OtherClients    *otherClients;  /* other clients that want events */
  378.     int            number;        /* index of this buffer into array */
  379.     int            side;        /* always Mono */
  380.     int            clobber;        /* Unclobbered, PartiallyClobbered, FullClobbered */
  381.     PixmapPtr        pPixmap;        /* associated pixmap */
  382. } MultibufferRec, *MultibufferPtr;
  383.  
  384. /*
  385.  * per-window data
  386.  */
  387.  
  388. typedef struct _Multibuffers {
  389.     WindowPtr    pWindow;        /* associated window */
  390.     int        numMultibuffer;        /* count of buffers */
  391.     int        refcnt;            /* ref count for delete */
  392.     int        displayedMultibuffer;    /* currently active buffer */
  393.     int        updateAction;        /* Undefined, Background, Untouched, Copied */
  394.     int        updateHint;        /* Frequent, Intermittent, Static */
  395.     int        windowMode;        /* always Mono */
  396.  
  397.     TimeStamp    lastUpdate;        /* time of last update */
  398.  
  399.     unsigned short    width, height;    /* last known window size */
  400.     short        x, y;        /* for static gravity */
  401.  
  402.     MultibufferPtr    buffers;        /* array of numMultibuffer buffers */
  403. } MultibuffersRec;
  404.  
  405. /*
  406.  * per-screen data
  407.  */
  408. typedef struct _MultibufferScreen {
  409.     PositionWindowProcPtr PositionWindow;        /* pWin, x,y */
  410. } MultibufferScreenRec, *MultibufferScreenPtr;
  411.  
  412. /*
  413.  * per display-image-buffers request data.
  414.  */
  415.  
  416. typedef struct _DisplayRequest {
  417.     struct _DisplayRequest    *next;
  418.     TimeStamp            activateTime;
  419.     ClientPtr            pClient;
  420.     XID                id;
  421. } DisplayRequestRec, *DisplayRequestPtr;
  422.  
  423. #define DestroyWindowMask        (1L<<0)
  424. #define PositionWindowMask        (1L<<1)
  425. #define PostValidateTreeMask        (1L<<2)
  426. #define ClipNotifyMask            (1L<<3)
  427. #define WindowExposuresMask        (1L<<4)
  428. #define CopyWindowMask            (1L<<5)
  429. #define ClearToBackgroundMask        (1L<<6)
  430. #define ChangeWindowAttributesMask    (1L<<7)    
  431.  
  432. extern int        MultibufferScreenIndex;
  433. extern int        MultibufferWindowIndex;
  434.  
  435. extern RESTYPE        MultibufferDrawableResType;
  436.  
  437. extern void        MultibufferUpdate(    /* pMbuffer, time */
  438.                 MultibufferPtr /* pMultibuffer */,
  439.                 CARD32 /* time */
  440.                 );
  441. extern void        MultibufferExpose(    /* pMbuffer, pRegion */
  442.                 MultibufferPtr /* pMultibuffer */,
  443.                 RegionPtr /* pRegion */
  444.                 );
  445. extern void        MultibufferClobber(    /* pMbuffer */
  446.                 MultibufferPtr /* pMultibuffer */
  447.                 );
  448.  
  449. typedef struct _mbufWindow    *mbufWindowPtr;
  450.  
  451. /*
  452.  * per-buffer data
  453.  */
  454.  
  455. #define MB_DISPLAYED_BUFFER(pMBWindow) \
  456.     ((pMBWindow)->buffers + (pMBWindow)->displayedMultibuffer)
  457.  
  458. typedef struct _mbufBuffer {
  459.     mbufWindowPtr   pMBWindow;        /* associated window data */
  460.     Mask        eventMask;        /* client event mask */
  461.     Mask        otherEventMask; /* union of other clients' event masks */
  462.     OtherClientsPtr otherClients;   /* other clients that want events */
  463.     int            number;        /* index of this buffer into array */
  464.     int            side;        /* stero side: always Mono */
  465.     int            clobber;        /* clober state */
  466.     DrawablePtr        pDrawable;        /* associated drawable */
  467. } mbufBufferRec, *mbufBufferPtr;
  468.  
  469.  
  470. /*
  471.  * per-window data
  472.  */
  473.  
  474. #define MB_WINDOW_PRIV(pWin) \
  475.     ((mbufWindowPtr)((pWin)->devPrivates[MultibufferWindowIndex].ptr))
  476.  
  477. typedef struct _mbufWindow {
  478.     WindowPtr    pWindow;        /* associated window */
  479.     int        numMultibuffer;        /* count of buffers */
  480.     mbufBufferPtr buffers;        /* array of (numMultibuffer) buffers */
  481.     int        displayedMultibuffer;    /* currently active buffer */
  482.     int        updateAction;        /* Undefined, Background,
  483.                        Untouched, Copied */
  484.     int        updateHint;        /* Frequent, Intermittent, Static */
  485.     int        windowMode;        /* always Mono */
  486.     TimeStamp    lastUpdate;        /* time of last update */
  487.     short        x, y;        /* for static gravity */
  488.     unsigned short    width, height;    /* last known window size */
  489.     DevUnion        devPrivate;
  490. } mbufWindowRec;
  491.  
  492.  
  493. /*
  494.  * per-screen data
  495.  */
  496.  
  497. #define MB_SCREEN_PRIV(pScreen) \
  498.     ((mbufScreenPtr)((pScreen)->devPrivates[MultibufferScreenIndex].ptr))
  499.  
  500. typedef struct _mbufScreen {
  501.     long mbufWindowCount;        /* count of multibuffered windows */
  502.  
  503.     /* Wrap pScreen->DestroyWindow */
  504.     DestroyWindowProcPtr DestroyWindow;
  505.     long funcsWrapped;            /* flags which functions are wrapped */
  506.  
  507.     /* Initialized by device-dependent section */
  508.     int  nInfo;                /* number of buffer info rec's */
  509.     xMbufBufferInfo *pInfo;        /* buffer info (for Normal buffers) */
  510.  
  511.     int  (* CreateImageBuffers)(
  512.         WindowPtr        /* pWin */,
  513.         int            /* nbuf */,
  514.         XID *            /* ids */,
  515.         int            /* action */,
  516.         int            /* hint */
  517.             );
  518.     void (* DestroyImageBuffers)(
  519.         WindowPtr        /* pWin */
  520.             );
  521.     void (* DisplayImageBuffers)(
  522.         ScreenPtr        /* pScreen */,
  523.         mbufBufferPtr *        /* ppMBBuffer */,
  524.         mbufWindowPtr *        /* ppMBWindow */,
  525.         int            /* nbuf */
  526.             );
  527.     void (* ClearImageBufferArea)(
  528.         mbufBufferPtr        /* pMBBuffer */,
  529.         short            /* x */,
  530.         short            /* y */,
  531.         unsigned short        /* width */,
  532.         unsigned short        /* height */,
  533.         Bool            /* exposures */
  534.             );
  535.     Bool (* ChangeMBufferAttributes)(    /* pMBWindow, vmask */ 
  536.             /* FIXME */
  537.             );
  538.     Bool (* ChangeBufferAttributes)(    /* pMBBuffer, vmask */
  539.             /* FIXME */
  540.             );
  541.     void (* DeleteBufferDrawable)(
  542.         DrawablePtr        /* pDrawable */
  543.             );
  544.     void (* WrapScreenFuncs)(
  545.         ScreenPtr        /* pScreen */
  546.             );
  547.     void (* ResetProc)(
  548.         ScreenPtr        /* pScreen */
  549.             );
  550.     DevUnion    devPrivate;
  551. } mbufScreenRec, *mbufScreenPtr;
  552.  
  553.  
  554. /* Privates to mbufScreenRec */
  555.  
  556. #ifdef _MULTIBUF_PIXMAP_
  557. #define MB_SCREEN_PRIV_PIXMAP(pScreen) \
  558.     ((mbufPixmapPrivPtr) MB_SCREEN_PRIV((pScreen))->devPrivate.ptr)
  559.  
  560. typedef struct _mbufPixmapPriv
  561. {
  562.     /* Pointers to wrapped functions */
  563.     PositionWindowProcPtr PositionWindow;        /* pWin, x,y */
  564.     long funcsWrapped;            /* flags which functions are wrapped */
  565. } mbufPixmapPrivRec, *mbufPixmapPrivPtr;
  566. #endif /* _MULTIBUF_PIXMAP_ */
  567.  
  568.  
  569. #ifdef _MULTIBUF_BUFFER_
  570.  
  571. extern int frameWindowPrivateIndex;
  572.  
  573. #define MB_SCREEN_PRIV_BUFFER(pScreen) \
  574.     ((mbufBufferPrivPtr) MB_SCREEN_PRIV((pScreen))->devPrivate.ptr)
  575.  
  576. typedef struct _mbufBufferPriv
  577. {
  578.     DevUnion    *frameBuffer;    /* Array of screen framebuffers */
  579.     DevUnion    selectPlane;    /* Plane(s) that select displayed buffer */
  580.  
  581.     /* 
  582.      * Note: subtractRgn and unionRgn may overlap. subtractRgn is a union
  583.      * of all the old clipLists of the windows that are displaying
  584.      * the backbuffer. unionRgn is the union of all the new clipLists
  585.      * of the same windows.
  586.      */
  587.  
  588.     RegionRec    backBuffer;    /* Area of screen displaying back buffer */
  589.     RegionRec   subtractRgn;    /* Regions lost to backBuffer   */
  590.     RegionRec   unionRgn;    /* Regions gained by backBuffer */
  591.     Bool    rgnChanged;    /* TRUE if "backBuffer" needs to be updated */
  592.  
  593.     void (* CopyBufferBits)();    /* pMBWindow, srcBufferNum, dstBufferNum */
  594.     void (* DrawSelectPlane)();    /* pScreen, selectPlane, pRegion, bufferNum */
  595.  
  596.     /* Pointers to wrapped functions */
  597.     PostValidateTreeProcPtr    PostValidateTree; /* pParent, pChild, kind */
  598.     ClipNotifyProcPtr        ClipNotify;       /* pWin, dx, dy */
  599.     WindowExposuresProcPtr    WindowExposures;  /* pWin, pRegion */
  600.     CopyWindowProcPtr        CopyWindow;       /* pWin, oldPt, pOldRegion */
  601.     ClearToBackgroundProcPtr    ClearToBackground; /* pWin, x,y,w,h, sendExpose */
  602.     ChangeWindowAttributesProcPtr ChangeWindowAttributes; /* pWin, vmask */
  603.     long funcsWrapped;            /* flags which functions are wrapped */
  604.     unsigned  inClearToBackground:1;    /* used by WindowExposure */
  605. } mbufBufferPrivRec, *mbufBufferPrivPtr;
  606. #endif /* _MULTIBUF_BUFFER_ */
  607.  
  608. #endif /* _MULTIBUF_SERVER_ */
  609. #endif /* _MULTIBUFST_H_ */
  610.